A virtual network (VN) is a computer network that comprises virtual network nodes and/or links. The concept and adoption of virtual networks (VNs) have become widely popular due to various reasons such as the need for rapid service introduction and savings of operational cost in cloud computing. A VN may be formed with or without a corresponding physical network topology. To create and operate a VN, network applications may call an application programming interface (API) provided by a network controller controlling the VN. For example, requests from an application may be transmitted to the controller via the API one at a time, and a VN may be built or updated according to the request to fit the need of the application.
Application developers today may use a procedural approach to operate a VN. In this approach, an application may use a controller API to build a step-by-step procedure that represents application logic for operating the VN. Building the procedural steps may require application developers to have intimate knowledge of the VN (e.g., how the VN is built). As the scale and complexity of a VN grows, the VN may become increasingly difficult to manage for application developers.